/**
 * 月份转天数
 * @param month
 * @returns {number}
 */
function month2Day(month: number) {
  let s = 0;
  let d;
  const data = new Date();
  const year = data.getFullYear();
  data.setMonth(data.getMonth() + 1, 1);
  for (let i = 0; i < month; i++) {
    data.setMonth(data.getMonth() - 1);
    let m: any = data.getMonth() + 1;
    m = m < 10 ? '0' + m : m;
    d = new Date(year, m, 0);
    s += d.getDate();
  }

  return s
}

export default month2Day;
